package com.scau.database.controller.salesperson;

import com.scau.data.entity.RepairStoreDO;
import com.scau.database.entity.salesperson.AfterSaleCenterQuery;
import com.scau.database.entity.salesperson.SalesInfoVO;
import com.scau.database.service.salesperson.SalesInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: x1aolone
 * @Date: 2020/5/13 13:31
 */
@RestController
@RequestMapping("/api/salesPerson")
public class SalesInfoController {

    @Autowired
    public SalesInfoService salesInfoService;

    @GetMapping("/getSalesInfo/{shopId}")
    public SalesInfoVO getSalesInfo(@PathVariable Long shopId) {
        return salesInfoService.getSalesInfo(shopId);
    }

    /**
     * 记录第三方维修点
     * @param DO 第三方维修点信息
     * @return 插入成功返回1
     */
    @PostMapping("/recordAfterSaleCenter")
    public Integer recordAfterSaleCenter(@RequestBody RepairStoreDO DO) {
        return salesInfoService.recordAfterSaleCenter(DO);
    }


}
